//
//  NewsflashRecommendCell.m
//  AutoHome
//
//  Created by wqh on 15-5-11.
//  Copyright (c) 2015年 Wqh. All rights reserved.
//

#import "NewsflashRecommendCell.h"

@implementation NewsflashRecommendCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)showDataWithModel:(RecommendModel *)model {
    self.titleLabel.text = model.title;
    [self.bgimageView sd_setImageWithURL:[NSURL URLWithString:model.bgimage] placeholderImage:[UIImage imageNamed:@"black_default_640_320"]];
    self.reviewcountLabel.text = [NSString stringWithFormat:@"%@位观众",[model.reviewcount stringValue]];
    self.createTimeLabel.text = model.createtime;
    self.typenameLabel.text =model.typename;
    if ([model.state.stringValue isEqualToString:@"1"]) {
        self.stateLabel.text = @"播报中";
        self.stateLabel.textColor = [UIColor whiteColor];
        self.stateLabel.backgroundColor = [UIColor customBlueColor];
    }else {
        self.stateLabel.text = @"播报结束";
        self.stateLabel.textColor = [UIColor blackColor];
        self.stateLabel.backgroundColor = [UIColor lightGrayColor];
    }
}

@end
